﻿using Newtonsoft.Json;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;

namespace ThresholdAssistant.WebAPI.Models
{
    /// <summary>
    /// 标签类型列表查询参数模型
    /// </summary>
    public class AddThresholdParam
    {
        /// <summary>
        /// 分组ID
        /// </summary>
        [JsonProperty("group_id"), JsonPropertyName("group_id")]
        [Required(ErrorMessage = nameof(ErrorResultEnum.GroupIdIsNull))]
        public long GroupId { get; set; }

        /// <summary>
        /// 标签类型ID
        /// </summary>
        [JsonProperty("tagtype_id"), JsonPropertyName("tagtype_id")]
        [Required(ErrorMessage = nameof(ErrorResultEnum.TagtypeIdIsNull))]
        public long TagtypeId { get; set; }

        /// <summary>
        /// 用户id
        /// </summary>
        [JsonProperty("member_id"), JsonPropertyName("member_id")]
        [Required(ErrorMessage = nameof(ErrorResultEnum.MemberIdIsNull))]
        public long MemberId { get; set; }

        /// <summary>
        /// 标签类型名称
        /// </summary>
        [JsonProperty("name"), JsonPropertyName("name")]
        [Required(ErrorMessage = nameof(ErrorResultEnum.NameIsNull))]
        public string Name { get; set; }

        /// <summary>
        /// 标签类型名称
        /// </summary>
        [JsonProperty("threshold_type"), JsonPropertyName("threshold_type")]
        [Required(ErrorMessage = nameof(ErrorResultEnum.ThresholdTypeIsNull))]
        public int ThresholdType { get; set; }

        /// <summary>
        /// 开始值
        /// </summary>
        [JsonProperty("start_value"), JsonPropertyName("start_value")]
        [Required(ErrorMessage = nameof(ErrorResultEnum.StartValueIsNull))]
        public double StartValue { get; set; }

        /// <summary>
        /// 结束值
        /// </summary>
        [JsonProperty("end_value"), JsonPropertyName("end_value")]
        [Required(ErrorMessage = nameof(ErrorResultEnum.EndValueIsNull))]
        public double EndValue { get; set; }

        /// <summary>
        /// 明细列表
        /// </summary>
        [JsonProperty("detail_list"),JsonPropertyName("detail_list")]
        public List<ThresholdDetailParam> DetailList { get; set; } = new List<ThresholdDetailParam>();
    }
}
